package com.bcxj.apipassenger.controller;

import com.bcxj.apipassenger.Service.TokenService;
import com.bcxj.internalcommon.constant.CommonStatusEnum;
import com.bcxj.internalcommon.dto.ResponseResult;
import com.bcxj.internalcommon.dto.TokenResult;
import com.bcxj.internalcommon.response.TokenResponse;
import com.bcxj.internalcommon.util.JwtUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: RefreshTokenController
 * Package: com.bcxj.apipassenger.controller
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/10/1 21:09
 * @Version 1.0
 * @Since 1.0
 */
@RestController
public class RefreshTokenController {

    @Autowired
    private TokenService tokenService;

    /**
     * refreshToken的刷新
     * @param tokenResponse
     * @return TokenResponse
     */
    @PostMapping("/token-refresh")
    public ResponseResult refreshToken(@RequestBody TokenResponse tokenResponse) {
        return tokenService.refreshToken(tokenResponse);
    }
}
